package com.ccsoft.atools.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class Vue3menuNode implements Serializable {
    private Integer id;

    private String name;

    private Integer type;

    private String url;

    private String icon;

    private Integer sort;

    private Integer parent_id;

    private String permission;

    private Date create_time;

    private List<Vue3menuNode> children;

    private Boolean has_children;

    private static final long serialVersionUID = 1L;

    public Vue3menuNode(Vue3menu r) {
        this.id = r.getId();
        this.name = r.getName();
        this.type = r.getType();
        this.url = r.getUrl();
        this.icon = r.getIcon();
        this.sort = r.getSort();
        this.parent_id = r.getParent_id();
        this.permission = r.getPermission();
        this.create_time = r.getCreate_time();
        this.children = new ArrayList<>();
        if (r.getType() == 3)
            this.has_children = false;
        else
            this.has_children = true;

    }
}
